home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
3D Game Programming All in One
/
3D Game Programming All in One Disc.iso
/
3D2E
/
RESOURCES
/
CH2
/
LoopPrint.cs
< prev
next >
Wrap
Text File
|
2006-05-29
|
737b
|
20 lines
// ========================================================================
// LoopPrint.cs
//
// Solution to while challenge
// ========================================================================
function runLoopPrint()
// ----------------------------------------------------
// Entry point for the program.
// ----------------------------------------------------
{
%value = 0; // initialize %n
while (%value < 250) // stop looping if %n exceeds 250
{
%value = GetRandom(350); // get a random number between 0 and 350
echo("n="@%value); // print the result
} // back to the top of the loop
// ie. do it all again
}